<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title data-i18n="resources.title_layerSwitcher"></title>
    <script type="text/javascript" src="../js/include-web.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var map, worldLayer, layer;
    var url = host + "/iserver/services/map-world/rest/maps/World";
    map = new SuperMap.Map("map", {
        controls: [
            new SuperMap.Control.Navigation({     //添加Navigation控件到map
                dragPanOptions: {
                    enableKinetic: true
                }
            }),
            new SuperMap.Control.LayerSwitcher()
        ], allOverlays: true
    });

    var options = {numZoomLevels: 12, useCanvas: false};
    var bounds = new SuperMap.Bounds(-180, -90, 180, 90);
    layer = new SuperMap.Layer.Image(        //image图层
        'World_Day',
        'images/Day.jpg',
        bounds,
        options
    );
    worldLayer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {transparent: true, cacheEnabled: true});   //获取World地图服务地址
    worldLayer.events.on({"layerInitialized": addLayer});

    function addLayer() {
        map.addLayers([worldLayer, layer]);
        map.setCenter(new SuperMap.LonLat(0, 0), 2);
    }

</script>
</body>
</html>